package com.personal.controller;

import com.personal.service.PersonalCenterService;
import com.personal.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

@RestController
@RequestMapping("/personalCenter")
@Api(value = "PersonalCenterController", tags = "个人中心接口列表")
public class PersonalCenterController {

    @Autowired
    private PersonalCenterService personalCenterService;

    @GetMapping("/Sign")
    @ApiOperation("签到")
    public Result sign(@RequestParam("userId") Integer userId){
        return personalCenterService.sign(userId);
    }

    @GetMapping("/queryAccount")
    @ApiOperation("查询用户账户信息")
    public Result queryAccount(@RequestParam("userId") Integer userId){
        HashMap userAccount = personalCenterService.getUserAccount(userId);
        return Result.success(userAccount);
    }

}
